﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using blackhouse.BlackApart.Business.Opinions;

namespace blackhouse.BlackApart.Web.Navigation {
    public abstract class NavigationProvider : InstanceFactory<NavigationProvider> {

        #region INSTANCE

        public static NavigationProvider Instance() {
            return Instance("NavigationProvider", typeof(DefaultNavigationProvider));
        }

        #endregion

        #region Methods

        public string GetUrl(IOpinion opinion) {
            return GetUrlVisitor(opinion).Url;
        }

        public string GetUrl(SearchState search) {
            return GetUrlVisitor(search).Url;
        }

        public string GetUrl(ReservationPage page) {
            return GetUrlVisitor(page).Url;
        }

        protected abstract UrlVisitor GetUrlVisitor(IOpinion opinion);

        protected abstract UrlVisitor GetUrlVisitor(SearchState search);

        protected abstract UrlVisitor GetUrlVisitor(ReservationPage page);

        public abstract ReservationPage GetReservationPageFromRequest();

        #endregion

    }
}